﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using CityIT.Sales.Entities;
using CityIT.Sales.SqlServer;

namespace CityIT.Sales.Web
{
    public partial class Content : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //登录用
            Sys_Menu menu = new Sys_Menu();
            DataSet ds = menu.QueryMenus(0, 0);
            rptParentTree.DataSource = ds.Tables[0].DefaultView;
            rptParentTree.DataBind();
        }

        protected void rptParentTree_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string ROWID = ((DataRowView)e.Item.DataItem)[0].ToString();
                Sys_Menu menu = new Sys_Menu();
                DataSet ds = menu.QueryMenus(int.Parse(ROWID), 0);

                Repeater rptCurrentTree =e.Item.FindControl("rptCurrentTree") as Repeater;
                rptCurrentTree.DataSource = ds.Tables[0].DefaultView;
                rptCurrentTree.DataBind();
            }

        }
    }
}